from time import sleep

from common.base import BasePage
from selenium.webdriver.common.by import By


class LoginPage(BasePage):
    minE = (By.XPATH,"//font[@id='ECS_MEMBERZONE']/a[1]")
    unameE = (By.NAME, "username")
    upwdE = (By.NAME, "password")
    LogE = (By.NAME, "submit")


    def denglu(self,a, b):

        self.getElement(*self.unameE).send_keys(a)
        self.getElement(*self.upwdE).send_keys(b)
        self.getElement(*self.LogE).click()
        sleep(5)
    def login_ok(self):
        return self.getEleValue(self.login_unae)

    def login_error_msg(self):
        return self.getEleValue(self.login_unae)

    def login_error_alert(self):
        return self.getEleValue(self.login_unae)



if __name__ == '__main__':
    from pages.fristPage import FristPage
    lp = FristPage()
    lp.go_to_loginP().denglu('uroot', 'w12345678')
    lp.driver.quit()